home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 July / EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso / recent1 / miami21amain.lha / Install_Miami next >
Text File  |  1997-04-30  |  9KB  |  342 lines

  1. (procedure check-system-version
  2.  (set exec-version (/ (getversion) 65536))
  3.  (if (< exec-version 37)
  4.   (abort "Miami 2.1 needs Kickstart 2.04 or higher.\n")
  5.  )
  6.  (if (< exec-version 39)
  7.   (set ag-browser "AmigaGuide")
  8.   (set ag-browser "MultiView")
  9.  )
  10. )
  11.  
  12. (procedure select-destination-directory
  13.  (if (exists "Miami:" (noreq))
  14.   (
  15.    (set old-miami-assign 1)
  16.    (set old-miami-assign-location (expandpath "Miami:"))
  17.    (set @default-dest
  18.     (askdir
  19.      (prompt "Select the directory where you want to "
  20.       "install Miami 2.1. You already have a 'Miami:' "
  21.       "assign on your system, so it is assumed that this "
  22.       "is the location of an older version of Miami that "
  23.       "you want to upgrade.")
  24.      (help "Select the directory where you want to "
  25.       "install Miami 2.1. Since you already have a 'Miami:' "
  26.       "assign on your system you should probably accept "
  27.       "the default.")
  28.      (default "Miami:")
  29.     )
  30.    )
  31.   ) (
  32.    (set old-miami-assign 0)
  33.    (set @default-dest
  34.     (askdir
  35.      (prompt "Select the directory where you want to "
  36.       "install Miami 2.1. Most of the files do not have "
  37.       "to be copied if you accept the default. A separate "
  38.       "directory WILL NOT be created at the location you "
  39.       "specify.")
  40.      (help "Select the directory where you want to "
  41.       "install Miami 2.1. You can choose to install "
  42.       "'in-place', i.e. within the directory where your "
  43.       "Miami files are currently located, or you can have "
  44.       "Miami installed in a different location, copying "
  45.       "all files.")
  46.      (default source-dir)
  47.     )
  48.    )
  49.   )
  50.  )
  51.  (makeassign "Miami" @default-dest)
  52. )
  53.  
  54. (procedure check-registered
  55.  (set is-registered (exists (tackon @default-dest "Miami.key2")))
  56. )
  57.  
  58. (procedure select-cpu
  59.  (if is-registered
  60.   (set cpu-choice
  61.    (askchoice
  62.     (prompt "Please select which version of\nMiami you want to use:")
  63.     (help "Miami exists in a 68000 version,\n a 68020 version and an\n"
  64.      "unregistered version. The 68000 and 68020\n"
  65.      "versions can only be used by registered users.")
  66.     (choices "unregistered version" "registered 68000 version" "registered 68020 version")
  67.    )
  68.   )
  69.   (set cpu-choice 0)
  70.  )
  71. )
  72.  
  73. (procedure check-binary
  74.  (set bin-choice
  75.   (select cpu-choice
  76.    "Miami.eval"
  77.    "Miami.000"
  78.    "Miami.020"
  79.   )
  80.  )
  81.  (if (not (exists (tackon source-dir bin-choice)))
  82.   (abort "Before you can install Miami you first need to\n"
  83.    "download and unpack the archive that contains the Miami\n"
  84.    "binary you want to install.")
  85.  )
  86. )
  87.  
  88. (procedure select-icon
  89.  (set icon-choice
  90.   (askchoice
  91.    (prompt "Please select which icons you\nwant to use:")
  92.    (help "Miami comes with three different\nicon styles. Please select\n"
  93.     "the one you prefer.")
  94.    (choices "do not install new icons" "standard" "Magic Workbench" "NewIcons")
  95.   )
  96.  )
  97. )
  98.  
  99. (procedure check-in-place
  100.  (set is-in-place
  101.   (= (expandpath source-dir) (expandpath @default-dest))
  102.  )
  103. )
  104.  
  105. (procedure copy-file
  106.  (copyfiles
  107.   (source (tackon source-dir to-copy))
  108.   (dest @default-dest)
  109.   (optional force)
  110.  )
  111. )
  112.  
  113. (procedure copy-files
  114.  (if (exists (tackon @default-dest "Miami"))
  115.   (delete (tackon @default-dest "Miami") force)
  116.  )
  117.  (if (not (= icon-choice 0)) (
  118.   (if (exists (tackon @default-dest "Miami.info"))
  119.    (delete (tackon @default-dest "Miami.info") force)
  120.   )
  121.  ))
  122.  (if is-in-place
  123.   (
  124.    (select cpu-choice
  125.     (
  126.      (delete (tackon @default-dest "Miami.020") force)
  127.      (delete (tackon @default-dest "Miami.020.info") force)
  128.      (delete (tackon @default-dest "Miami.000") force)
  129.      (delete (tackon @default-dest "Miami.000.info") force)
  130.      (rename (tackon @default-dest "Miami.eval") (tackon @default-dest "Miami"))
  131.      (delete (tackon @default-dest "Miami.eval.info") force)
  132.     )
  133.     (
  134.      (delete (tackon @default-dest "Miami.020") force)
  135.      (delete (tackon @default-dest "Miami.020.info") force)
  136.      (delete (tackon @default-dest "Miami.eval") force)
  137.      (delete (tackon @default-dest "Miami.eval.info") force)
  138.      (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  139.      (delete (tackon @default-dest "Miami.000.info") force)
  140.     )
  141.     (
  142.      (delete (tackon @default-dest "Miami.000") force)
  143.      (delete (tackon @default-dest "Miami.000.info") force)
  144.      (delete (tackon @default-dest "Miami.eval") force)
  145.      (delete (tackon @default-dest "Miami.eval.info") force)
  146.      (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  147.      (delete (tackon @default-dest "Miami.020.info") force)
  148.     )
  149.    )
  150.    (complete 50)
  151.   ) (
  152.    (select cpu-choice
  153.     (set to-copy "Miami.eval")
  154.     (set to-copy "Miami.000")
  155.     (set to-copy "Miami.020")
  156.    )
  157.    (copy-file)
  158.    (select cpu-choice
  159.     (rename (tackon @default-dest "Miami.eval") (tackon @default-dest "Miami"))
  160.     (rename (tackon @default-dest "Miami.000") (tackon @default-dest "Miami"))
  161.     (rename (tackon @default-dest "Miami.020") (tackon @default-dest "Miami"))
  162.    )
  163.    (set to-copy "Miami.guide") (copy-file)
  164.    (set to-copy "Miami.guide.info") (copy-file)
  165.    (set to-copy "MiamiArp") (copy-file)
  166.    (set to-copy "MiamiFinger") (copy-file)
  167.    (set to-copy "MiamiIfConfig") (copy-file)
  168.    (set to-copy "MiamiInit") (copy-file)
  169.    (set to-copy "MiamiInit.info") (copy-file)
  170.    (set to-copy "MiamiInitSANA2") (copy-file)
  171.    (set to-copy "MiamiInitSANA2.info") (copy-file)
  172.    (set to-copy "MiamiMapMBone") (copy-file)
  173.    (set to-copy "MiamiMRInfo") (copy-file)
  174.    (set to-copy "MiamiMRouteD") (copy-file)
  175.    (set to-copy "MiamiMTrace") (copy-file)
  176.    (set to-copy "MiamiNetStat") (copy-file)
  177.    (set to-copy "MiamiPing") (copy-file)
  178.    (set to-copy "MiamiRegister") (copy-file)
  179.    (set to-copy "MiamiRegister.info") (copy-file)
  180.    (set to-copy "MiamiResolve") (copy-file)
  181.    (set to-copy "MiamiRoute") (copy-file)
  182.    (set to-copy "MiamiSysCtl") (copy-file)
  183.    (set to-copy "MiamiTCPDump") (copy-file)
  184.    (set to-copy "MiamiTraceRoute") (copy-file)
  185.    (set to-copy "Miami_README") (copy-file)
  186.    (set to-copy "Miami_README.info") (copy-file)
  187.    (complete 25)
  188.    (if (not (exists (tackon @default-dest "libs")))
  189.     (makedir (tackon @default-dest "libs"))
  190.    )
  191.    (copyfiles
  192.     (source (tackon source-dir "libs"))
  193.     (dest (tackon @default-dest "libs"))
  194.     (all)
  195.    )
  196.   )
  197.  )
  198.  (if (not (= icon-choice 0)) (
  199.   (set to-copy
  200.    (select icon-choice
  201.     ""
  202.     "Icons/Standard/Miami.info"
  203.     "Icons/MagicWB/Miami.info"
  204.     "Icons/NewIcons/Miami.info"
  205.    )
  206.   )
  207.   (copyfiles
  208.    (source (tackon source-dir to-copy))
  209.    (dest @default-dest)
  210.   )
  211.   (copyfiles
  212.    (source (tackon source-dir to-copy))
  213.    (dest @default-dest)
  214.    (newname "MiamiInit.info")
  215.   )
  216.   (copyfiles
  217.    (source (tackon source-dir to-copy))
  218.    (dest @default-dest)
  219.    (newname "MiamiInitSANA2.info")
  220.   )
  221.   (copyfiles
  222.    (source (tackon source-dir to-copy))
  223.    (dest @default-dest)
  224.    (newname "MiamiRegister.info")
  225.   )
  226.  ))
  227.  (complete 50)
  228. )
  229.  
  230. (procedure set-tooltypes
  231.  (if (not (= icon-choice 0)) (
  232.   (tooltype
  233.    (dest (tackon @default-dest "Miami"))
  234.    (noposition)
  235.   )
  236.   (tooltype
  237.    (dest (tackon @default-dest "MiamiInit"))
  238.    (noposition)
  239.   )
  240.   (tooltype
  241.    (dest (tackon @default-dest "MiamiInitSANA2"))
  242.    (noposition)
  243.   )
  244.   (tooltype
  245.    (dest (tackon @default-dest "MiamiRegister"))
  246.    (noposition)
  247.   )
  248.   (tooltype
  249.    (dest (tackon @default-dest "Miami.guide"))
  250.    (noposition)
  251.    (setdefaulttool ag-browser)
  252.   )
  253.  ))
  254. )
  255.  
  256. (procedure add-to-startup
  257.  (if old-miami-assign
  258.   (if (= (old-miami-assign-location (expandpath @default-dest)))
  259.    (set change-startup 0)
  260.    (set change-startup 1)
  261.   )
  262.   (set change-startup 1)
  263.  )
  264.  (if change-startup
  265.   (
  266.    (set startup-addition (cat
  267.     "assign Miami: \"" (expandpath @default-dest) "\"\n"
  268.     )
  269.    )
  270.    (if
  271.     (askbool
  272.      (prompt "It is strongly recommended that an assign "
  273.       "'Miami:' is created for the Miami installation "
  274.       "directory. Miami by itself will work fine without "
  275.       "this assign, but some utility programs like "
  276.       "MiamiTCPDump need it. Would you like Installer "
  277.       "to make the required change to your user-startup "
  278.       "file ?")
  279.      (help "It is strongly recommended that an assign "
  280.       "'Miami:' is created for the Miami installation "
  281.       "directory. Miami by itself will work fine without "
  282.       "this assign, but some utility programs like "
  283.       "MiamiTCPDump need it. Please indicate if you would like Installer "
  284.       "to make the required change to your user-startup "
  285.       "file.")
  286.      (choices "Yes" "No")
  287.     )
  288.     (startup "Miami"
  289.      (command startup-addition)
  290.      (prompt "Installer will modify your s:user-startup "
  291.       "script. The following lines will be added:\n\n"
  292.       startup-addition)
  293.      (help "Installer will modify your s:user-startup "
  294.       "script. The following lines will be added:\n\n"
  295.       startup-addition)
  296.     )
  297.     (textfile
  298.      (dest (tackon @default-dest "addition-to-user-startup"))
  299.      (append startup-addition)
  300.     )
  301.    )
  302.   )
  303.  )
  304. )
  305.      
  306.  
  307. ;;;; Start
  308.  
  309. (welcome "Welcome to the Miami 2.1 installation.\n")
  310.  
  311. (set app-name "Miami 2.1")
  312.  
  313. (check-system-version)
  314.  
  315. (complete 0)
  316.  
  317. (set source-dir (if (= 1 (exists @icon)) (pathonly (expandpath @icon))
  318.  (expandpath @icon))
  319. )
  320.  
  321. (select-destination-directory)
  322.  
  323. (check-registered)
  324.  
  325. (select-cpu)
  326.  
  327. (check-binary)
  328.  
  329. (select-icon)
  330.  
  331. (check-in-place)
  332.  
  333. (copy-files)
  334.  
  335. (set-tooltypes)
  336.  
  337. (complete 75)
  338.  
  339. (add-to-startup)
  340.  
  341. (complete 100)
  342.